<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>PS1 成品庫齡150天警示</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">	
    <link rel="stylesheet" href="./4/lumen/bootstrap.css" media="screen">
    <link rel="stylesheet" href="./_assets/css/custom.min.css">
  </head>
  <body>
  <div class="container">
	<input type="radio" name="radio" id="radio1" value="1" />1    
	<input type="radio" name="radio" id="radio2" value="2" />2    
	<input type="radio" name="radio" id="radio3" value="3" />3    
	<input type="radio" name="radio" id="radio4" value="4" />4    
   
  	</div>
    <script src="./_vendor/jquery/dist/jquery.min.js"></script>
	<script>
		jQuery("input[type='radio'][name='radio']:checked").length == 0 ? "没有任何单选框被选中" : "已经有选中";    
		jQuery('input[type="radio"][name="radio"]:checked').val(); // 获取一组radio被选中项的值    
		jQuery("input[type='radio'][name='radio'][value='2']").attr("checked", "checked");// 设置value = 2的一项为选中    
		jQuery("#radio2").attr("checked", "checked"); // 设置id=radio2的一项为选中    
		jQuery("input[type='radio'][name='radio']").get(1).checked = true; // 设置index = 1，即第二项为当前选中    
		var isChecked = jQuery("#radio2").attr("checked");// id=radio2的一项处于选中状态则isChecked = true, 否则isChecked = false;    
		var isChecked = jQuery("input[type='radio'][name='radio'][value='2']").attr("checked");// value=2的一项处于选中状态则isChecked = true, 否则isChecked = false;  
	</script>
  </body>
</html>
	